<template>
  <div>
    <div v-if="!contractId" class="p-5 text-center">暂无确认函</div>
    <pdf-view v-else down-name="担保确认函" :contract-id="contractId" view-mode></pdf-view>
  </div>
</template>

<script>
import PdfView from '@/credit/views/county/unionProvince/components/PdfView'
export default {
  components: {
    PdfView,
  },
  props: {
    queryId: String,
  },
  data() {
    return {
      letter: {},
    }
  },
  computed: {
    contractId() {
      return this.letter.doc_id
    },
  },
  watch: {
    queryId: {
      handler: function () {
        this.getData()
      },
      immediate: true,
    },
  },
  created() {},
  mounted() {},
  methods: {
    getData() {
      this.$api
        .getData(this.$serviceName, 'ele_letter_bank', {
          'customer_related_id.eq': this.queryId,
        })
        .then(res => {
          this.letter = res?.data?.[0] ?? {}
        })
    },
  },
}
</script>

<style lang="scss" scoped></style>
